#include "mylabel.h"
#include <QDebug>
#include <QMouseEvent>
MyLabel::MyLabel(QWidget *parent) : QLabel(parent)
{

}

void MyLabel::enterEvent(QEvent *event)
{
    (void) event;
    qDebug() << "mouse come in!";
}

void MyLabel::leaveEvent(QEvent *event)
{
    (void) event;
    qDebug() << "mouse go out!";
}

void MyLabel::mousePressEvent(QMouseEvent *event)
{
    if(event->button() == Qt::LeftButton)
        qDebug() << "LeftButton have pressed";
    else if(event->button() == Qt::RightButton)
        qDebug() << "RightButton have pressed";
}

void MyLabel::mouseDoubleClickEvent(QMouseEvent *event)
{
    if(event->button() == Qt::LeftButton)
        qDebug() << "LeftButton have double pressed";
    else if(event->button() == Qt::RightButton)
        qDebug() << "RightButton have double pressed";
}
